package per.ace.rest.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import per.ace.rest.entity.Order;

/**
 * @program: springbootDemo
 * @description: service
 * @author: ace
 * @Date: 2020-04-13 20:38
 */
@Service
public class MyService {

    @Autowired
    private RestTemplate restTemplate;

    public void getUser(Long orderId) {
        Order forObject = restTemplate.getForObject("/order/{orderId}", Order.class, orderId);
        System.out.println(forObject.toString());
    }

}
